<form class="form-inline" method="get">
    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="user_condition" value="{$user_condition}"
                   placeholder="会员手机|昵称|ID">
        </div>
    </div>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <select id="type-selector" name="type" class="form-control" tabindex="-1">
                <option value="">无选择</option>
                {foreach $typeList as $item}
                <option value="{$item.type}" {if $type==$item['type']}selected{/if}>{$item.type_name}</option>
                {/foreach}
            </select>
        </div>
    </div>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <select id="status-selector" name="status" class="form-control" tabindex="-1">
                <option value="">无选择</option>
                <option value="1" {if $status!='' && $status==1}selected{/if}>已领取</option>
                <option value="0" {if $status!='' && $status==0}selected{/if}>待领取</option>
            </select>
        </div>
    </div>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <select id="send-status-selector" name="send_status" class="form-control" tabindex="-1">
                <option value="">无选择</option>
                <option value="1" {if $send_status!='' && $send_status==1}selected{/if}>已发货</option>
                <option value="0" {if $send_status!='' && $send_status==0}selected{/if}>待发货</option>
            </select>
        </div>
    </div>

    <div class="form-group col-xs-4">
        <div class="col-xs-12">
            <span style="">中奖时间</span>{include file="public/dateRangePicker" picker-name="time_range" /}
        </div>
    </div>

    <div class="form-group col-xs-1">
        <div class="col-xs-12">
            <button type="submit" class="btn btn-success">
                搜索
            </button>
        </div>
    </div>
</form>
<hr>
<table class="table table-bordered table-striped">
    <thead>
    <tr>
        <td>ID</td>
        <td>会员</td>
        <td>奖</td>
        <td>奖品</td>
        <td>奖品类型</td>
        <td>奖品图片</td>
        <td>领取状态</td>
        <td>发货信息</td>
        <td>中奖时间</td>
        <td>操作</td>
    </tr>
    </thead>
    <tbody>
    {volist name="list" id="item"}
    <tr>
        <td>{$item.id}</td>
        <td style="text-align: left">
            <p>ID：<label class="label label-primary">{$item.uid}</label></p>
            <p>昵称：{$item.nick_name}</p>
            <p>手机：<label class="label label-success">{$item.mobile}</label></p>
        </td>
        <td>{$item.title}</td>
        <td>
            <p>ID：{$item.lottery_id}</p>
            <p>名称：{$item.goods_title}</p>
            <p>数量：{$item.num}</p>
        </td>
        <td>{$item.type|get_lottery_type}</td>
        <td>
            <a href="javascript:void(0);" onclick="ejectImg('{$item.img_url}','奖品图片');">
                <img style="width:100px;" src="{$item.img_url|default_img}">
            </a>
        </td>

        <td>
            {if $item['status']==1}
            <label class="label label-success">已领取</label>
            <p>{$item.status_time|show_datetime}</p>
            {else/}
            <label class="label label-danger">待领取</label>
            {/if}
        </td>
        <td>
            <p>
                状态：
                {if $item['send_status']==1}
                <label class="label label-success">已发货</label>
                {else/}
                <label class="label label-danger">待发货</label>
                {/if}
            </p>
            {if $item['type']==1}
                <p>收货人：{$item.send_name}</p>
                <p>联系方式：{$item.send_mobile}</p>
                <p>收货地址：{$item.send_address}</p>
                {if $item.send_status==1}
                <p>快递：{$item.send_company}</p>
                <p>快递单号：{$item.send_sn}</p>
                <p>发货时间：{$item.send_time|show_datetime}</p>
                {/if}
            {/if}
        </td>
        <td>
            <p>{$item.create_time|show_datetime}</p>
        </td>

        <td>
            {if $item['status']==1&&$item['send_status']==0}
            <a href="javascript:void(0)" class="btn btn-primary btn-sm"
               onclick="modal('{:url(\'send\',array(\'id\'=>$item[\'id\']))}','确认发货','60%','60%')">确认发货</a>
            {/if}
        </td>

    </tr>
    {/volist}
    </tbody>
</table>

<div class="row">
    <div style="text-align: right;">
        {$list->render()}
    </div>
</div>

<script src="__PUBLIC__/vendors/select2/js/select2.min.js"></script>
<script type="application/javascript">
    $(function () {

        //获取分类
        $("#status-selector").select2({
            placeholder: "选择领取状态",
            allowClear: true
        });

        //获取分类
        $("#type-selector").select2({
            placeholder: "选择奖品类型",
            allowClear: true
        });

        //获取分类
        $("#send-status-selector").select2({
            placeholder: "选择发货状态",
            allowClear: true
        });
    });
</script>